/*
package com.seaboxdata.scheduler;

import com.seaboxdata.entity.BatchInterfaceConfig;

import java.util.HashMap;
import java.util.Map;

*/
/**
 * @author
 * @create 2021-07-15 14:48
 **//*

public class BigDataRunnable implements Runnable {

    private int begin;

    private int end;

    private int pageSize;

    private BigDataBatchInterfaceJob bigDataBatchInterfaceJob;

    private BatchInterfaceConfig batchInterfaceConfig;

    public BigDataRunnable(int begin, int end, int pageSize, BigDataBatchInterfaceJob bigDataBatchInterfaceJob, BatchInterfaceConfig batchInterfaceConfig) {
        this.begin = begin;
        this.end = end;
        this.pageSize = pageSize;
        this.bigDataBatchInterfaceJob = bigDataBatchInterfaceJob;
        this.batchInterfaceConfig = batchInterfaceConfig;
    }


    @Override
    public void run() {
        for (int i = 0; i < end % 1000 + 1; i++) {
            Map<String, String> paramsMap = new HashMap<>();
            paramsMap.put(BigDataBatchInterfaceJob.DEFAULT_ACCESS_TOKEN_KEY, bigDataBatchInterfaceJob.getAppkey());
            paramsMap.put(BigDataBatchInterfaceJob.DEFAULT_PAGESIZE_KEY, pageSize + "");
            paramsMap.put(BigDataBatchInterfaceJob.DEFAULT_PAGENUM_KEY, begin % pageSize + i + 1 + "");
            Map<String, String> headerMap = new HashMap<>();
            headerMap.put(BigDataBatchInterfaceJob.DEFAULT_CONTENT_TYPE_KEY, BigDataBatchInterfaceJob.DEFAULT_CONTENT_TYPE_VALUE);
            try {
                bigDataBatchInterfaceJob.handler(batchInterfaceConfig, paramsMap, headerMap, bigDataBatchInterfaceJob.getFieldInfos(batchInterfaceConfig));
            } catch (Exception e) {
                e.printStackTrace();
            }
        }
    }
}
*/
